#include<bits/stdc++.h>
#define int long long
#define base 7
#define mod 998244353
using namespace std;

int n, m;

int f[122][100005];
unordered_map<int, int>G; 
int tot, num[122][6], vis[6], now[6];
void dfs(int x) {
	if(x > n) {
		tot++;
		int sum = 0;
		for(int i = 1; i <= n; i++) {
			num[tot][i] = now[i];
			sum = sum * base + now[i]; 
		} 
		G[sum] = tot;
		return;
	}
	for(int i = 1; i <= n; i++) {
		if(vis[i]) continue;
		vis[i] = 1;
		now[x] = i;
		dfs(x + 1);
		vis[i] = 0;
	}
}
signed main() { 
	freopen("drama.in", "r", stdin);
	freopen("drama.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0); 
	
	cin >> n >> m;
	dfs(1);
	
	f[1][0] = 1;
	for(int j = 0; j < m; j++)
	for(int i = 1; i <= tot; i++) {
		for(int P = 1; P <= n; P++) {
			int who = num[i][1], sum = 0;
			for(int x = 1; x < P; x++) sum = sum * base + num[i][x + 1];
			sum = sum * base + num[i][1];
			for(int x = P + 1; x <= n; x++) sum = sum * base + num[i][x];
			int Nxt = G[sum];
			f[Nxt][j + 1] += f[i][j];
			if(f[Nxt][j + 1] >= mod) f[Nxt][j + 1] -= mod;
		}
	}
	cout << f[1][m];
	return 0;
}

